<!DOCTYPE html>
<html lang="zh-cmn-Hans">
  <head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="../../static/mobile/default/css/layout.css?v=2"/>
    <link rel="icon" type="image/png" href="../../static/favicon.ico"/>
        <script src="../../static/js/jquery/jquery/2.1.4/jquery.min.js"></script>
    <script src="../../static/js/jquery/jquery.cookie.js"></script>
    <script src="../../static/mobile/default/js/page.js?v=1"></script>
    <title>评论  - 达漂亮</title>
          
<link rel="stylesheet" href="../../static/mobile/default/css/my.css" />


</head>
<body >
  <div class="page evaluating">
    		<div class="page-hd">
            <div class="header base-header bor-1px-b">
                <div class="header-left">
                    <a href="javascript:history.go(-1)" class="left-arrow"></a>
                </div>
                <div class="header-title">评论</div>
                <div class="header-right">
                    <!-- <a href=""></a> -->
                </div>
            </div>
        </div>
      

 <div class="page-bd">
        <!-- 页面内容-->
        <div class="block">
          <div class="title fs32 fw_b color_3">商品信息</div>
          <a href="" class="goodsBox">
            <img src="" alt=""> 
            <div class="info">
              <div class="name fs28 color_3 textline_2 goods_name"></div>
              <div class="type fs28 color_9 sku"></div>
              <div class="infoBott">
                <div class="money">
                    <div class="color_3 fs24 num"><p class="fw_b fm_p">￥</p><em class="fs36 price_a"></em><p class="price_b"></p></div>
                </div>
              </div>
            </div>                  
          </a>
        </div>
        <div class="block">
          <div class="title fs32 fw_b color_3">评价</div>
          <textarea placeholder="请输入您的评价~" class="fs28 color_3" rows="4" maxlength="100" id="textBox"></textarea>
          <span class="textlength fs28 color_9 num" id="wordNum">0/100</span>
        </div>
        <div class="block">
          <div class="uploading">
            <div class="title fs32 fw_b color_3">上传照片</div>
            <div class="uploadBox" >
              
               <div class="Box">
                  <img src="../../static/mobile/default/images/addImg.png" alt="" class="imgBox">
                  <input type="file" class="uploadInput" >                  
                </div>
                <div c></div>
            </div>
          </div>
        </div>
        <div class="butt">
          <span class="fs32 fw_b color_w BGcolor_r postBtn">提交</span>
        </div>
</div>



  </div>

<script src="../../static/js/art-template.js"></script>
<script src="../../static/mobile/default/js/lib/fastclick.js"></script>
<script src="../../static/js/jquery/lazyload/jquery.lazyload.js"></script>
<script>
    $(function() {
        FastClick.attach(document.body);
		$("img.lazy").lazyload({effect:"fadeIn",event:"scroll",container:$(".page-bd")});
    });
</script>

 <script>
    countTxtEvent("textBox","wordNum",100)
	jq_ajax('/shop/api.comment/getinfo/rec_id/439.html','',function(res){
		if (res.code == 0){
			_alert(res.errmsg);
			return false;	
		}
		$('.goodsBox').attr('href','/shop/goods/info/id/'+res.data.goods_id+'.html');
		$('.goodsBox').find('img').attr('src',res.data.pic);
		$('.goodsBox').find('.goods_name').html(res.data.goods_name);
		$('.goodsBox').find('.sku').html(res.data.sku_name);
		$('.goodsBox').find('.price_a').html(res.data.exp_price[0]);
		$('.goodsBox').find('.price_b').html('.'+res.data.exp_price[1]);
	});

var isPost = false
var fd = new FormData();
var imgNum = 0;
$('.postBtn').click(function(){
	//console.log(fd.get("imgfile["+imgNum+"]"));
	var re = /[\u4E00-\u9FA5]/g; //测试中文字符的正则
	var content = $('#textBox').val();
	if (re.test(content)){ //使用正则判断是否存在中文	
		if (content.match(re).length <= 10) { //返回中文的个数
			_alert("评论不能小于10个汉字.");
			return false;
		}
	}else{
		_alert("评论不能小于10个汉字.");
		return false;
	}
	fd.append("rec_id", 439);
	fd.append("content", content);
	
	$.ajax({
		  url: '/shop/api.comment/post.html',
		  type: 'post',
		  processData: false,
		  contentType: false,
		  data: fd,
		  success: function (res) {
			 if (res.code == 0){
				  _alert(res.errmsg);
				  return false;	
			  }
			  _alert(res.errmsg,'/shop/comment/index.html');			  
		  }
	})


})



</script>
<script src="../../static/mobile/default/js/uploadsimage.js?v=1"></script>
<script>
    //处理点击改变的调用函数-做IOS兼容
    $(_listenSelector).click(function(){
            var that = $(this);
            _uplocalfunction=function(base64Img){
				if ($('.appendBox').length >= 6){
					_alert('最多允许上传6张图片.');
					return false;	
				}
				_imgNum++;
				fd.append("imgfile["+_imgNum+"]", base64Img);
				$(that).parent().before('<div class="Box"><img src="'+base64Img+'" alt="" class="imgBox appendBox"><img src="../../static/mobile/default/images/closeImg.png" alt="" data-imgnum="'+_imgNum+'" class="closeImg"></div>');
			}
    })
</script>    

  <div class="alertBox">
      <div class="alertBG"></div>
      <div class="alert">
          <div class="text fs30 color_3 bor_b">

          </div>
          <!-- 单按钮 -->
          <div class="button fs32 fw_b color_r">
              知道了
          </div>
          <!-- 双按钮 -->
          <div class="buttonBox fs32 fw_b">
              <span class="color_9 bor_r cancel">取消</span>
              <span class="color_r confirm">确定</span>
          </div>
      </div>
  </div>
  <script type="text/javascript">
      var is_xcx = 0;
      $(document).on('click', 'a', function () {
          var href = $(this).attr('href');
          if (href.indexOf('/pages') != -1) {
              if (is_xcx == 1) {
                  wx.miniProgram.navigateTo({
                      url: href
                  })
                  return false;
              } else {
                  return false;
              }
          }
      })
  </script>
    </body>
</html>